<template>
  <view>
	 <u-list >
	 	<uni-card :is-shadow="true" v-for="item in value.data" :key="item.id" >
	 	<u-list-item   >
	 			   <view class="card-content">
	 			   <view class="card-avatar" :style="{backgroundColor:thumb}"></view>
	 			   
	 			     <view class="card-title">房间号：{{ item.roomNo }}</view>
	 			     <view class="card-details"></view>
	 			     
	 			     <view class="card-details">预定时间: {{ item.billTime }}</view>
					 
	 			   </view>
	 </u-list-item></uni-card>
	 </u-list>
  </view>
</template>

<script>
	import * as dd from 'dingtalk-jsapi';
export default {
	
  data() {
   return {
   				value:[],
				thumb:'#dfdfdf',
				userId:'',
   			}
  },
  methods: {
	getBill(){
		uni.request({
			url:`http://localhost:8088/system/bill/selectTeacherBill/${this.userId}`,
			method:'GET',
			success:(res)=>{
			
			this.value=res.data;
			
			}
			
		})
	}
  },
  onReady() {
	  
  	
	dd.getAuthCode({
					corpId: 'ding0a40cdce33c8deb624f2f5cc6abecb85',
					success: (res) => {
						const {code}=res
							uni.request({
								url:`http://localhost:8088/system/dingding/v2/user/${code}`,
								success:(res)=> {
									const{userid}=res.data.result
									
									this.userId=userid
									this.getBill();
								}
								
							})
									  },
				    fail: () => {},
					complete: () => {},
					});
					
  }
};
</script>

<style>
.card-content{
	display: flex;
}
.card-avatar {
  width: 60px;
  height: 60px;
  
  margin-right: 10px;
}.card-title {
  font-size: 18px;
  margin: 18rpx;
}
.card-details{
	margin: 20rpx;
}

.item {
		line-height: 100rpx;
		text-align: center;
	}
	.dropdown{
		margin-left: 50rpx;
	}
</style>